<!-- 
	报价表 item 
-->
<template>
    <mescroll-uni
        ref="mescroll"
        @init="mescrollInit"
        :height="height"
        :down="downOption"
        @down="downRefresh"
        :up="upOption"
        @up="getData">
        <examine-item
            v-for="(item, index) in datas"
            :key="index"
            :item="item"
            @recall="recallFn"
            @quotation="quotationFn"></examine-item>
    </mescroll-uni>
</template>
<script>
import examineItem from "@/pages_supplier/components/quotation/examine-item.vue"
import { GetOfferSkuPriceList } from "@/pages_supplier/service/api/supplier.js"
export default {
    components: {
        examineItem,
    },
    props: {
        state: {
            type: Number,
            default: 0,
        },
        height: {
            type: String,
            default: "500rpx",
        },
    },
    data() {
        return {
            price: "",
            datas: [],
            param: {},
            downOption: {
                use: true,
            },
        }
    },
    mounted() {},
    methods: {
        //获取列表数据
        getData(page) {
            let param = this.param
            param.pageSize = page.size
            param.pageIndex = page.num
            let path = "?State=" + this.state + "&id=" + this.param.id
            GetOfferSkuPriceList(param, path).then((res) => {
                if (res.State == 1) {
                    this.mescroll.endBySize(res.Data.length, res.RecordAmout)
                    this.datas = this.datas.concat(res.Data)
                } else {
                    this.mescroll.endBySize(0, 0)
                }
            })
        },
        //刷新
        refresh(param) {
            if (param) {
                this.param = param
            }
            this.downRefresh()
        },
        //刷新
        downRefresh() {
            this.datas = []
            this.mescroll.resetUpScroll()
        },
        recallFn(e) {
            this.$emit("recall", e)
        },
        quotationFn(e) {
            this.$emit("quotation", e)
        },
    },
}
</script>

<style lang="scss"></style>
